Remove the reason code from the destroy action -- the reason is only of value
authoremellor@ewan <emellor@ewan>
Mon, 3 Oct 2005 23:56:24 +0000 (00:56 +0100)
committeremellor@ewan <emellor@ewan>
Mon, 3 Oct 2005 23:56:24 +0000 (00:56 +0100)
on a graceful shutdown.  Clarify the semantic difference between poweroff and
halt (we use halt to mean 'shutdown and stop' and poweroff to mean 'shutdown
and do whatever the configured behaviour is').

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/sv/DomInfo.py
tools/python/xen/xend/XendClient.py
tools/python/xen/xend/server/SrvDomain.py

index 12135cd4fb387386f9dfca65ca41ff1fb3c118da..89feca01a5d0ab19689684cd27d507f09e25678d 100755 (executable)
@@ -139,7 +139,7 @@ class DomActionTab( ActionTab ):
         if not dom is None and dom != '0':
           if DEBUG: print ">DomShutDown %s" % dom
            try:
-               server.xend_domain_shutdown( int( dom ), "halt" )
+               server.xend_domain_shutdown( int( dom ), "poweroff" )
            except:
                pass
     
@@ -175,7 +175,7 @@ class DomActionTab( ActionTab ):
         if not dom is None and dom != '0':
           if DEBUG: print ">DomDestroy %s" % dom
            try:
-               server.xend_domain_destroy( int( dom ), "halt" )
+               server.xend_domain_destroy(int( dom ))
            except:
                pass
 
index e0b4babc49230fc5bd39cbc9fcc5e9ca118cd0d5..0919ae6da6421f153d7b4b85bb7e2febd4cdc5c8 100644 (file)
@@ -232,10 +232,9 @@ class Xend:
                              {'op'      : 'sysrq',
                               'key'     : key})
 
-    def xend_domain_destroy(self, id, reason):
+    def xend_domain_destroy(self, id):
         return self.xendPost(self.domainurl(id),
-                             {'op'      : 'destroy',
-                              'reason'  : reason })
+                             {'op'      : 'destroy' })
 
     def xend_domain_save(self, id, filename):
         return self.xendPost(self.domainurl(id),
index 896f5b400336ab8311a5b20dca2b13bed671e262..6b9cb7b202ad533e4fac13e7d6c13c9f398490d4 100644 (file)
@@ -71,8 +71,7 @@ class SrvDomain(SrvDir):
 
     def op_destroy(self, op, req):
         fn = FormFn(self.xd.domain_destroy,
-                    [['dom',    'int'],
-                     ['reason', 'str']])
+                    [['dom',    'int']])
         val = fn(req.args, {'dom': self.dom.domid})
         req.setHeader("Location", "%s/.." % req.prePathURL())
         return val
@@ -232,8 +231,6 @@ class SrvDomain(SrvDir):
 
         req.write('<form method="post" action="%s">' % url)
         req.write('<input type="submit" name="op" value="destroy">')
-        req.write('<input type="radio" name="reason" value="halt" checked>Halt')
-        req.write('<input type="radio" name="reason" value="reboot">Reboot')
         req.write('</form>')
 
         req.write('<form method="post" action="%s">' % url)